import App from './App'
import Http from '@/common/banmi/request.js';
import Banmikeji from '@/common/banmi/banmikeji.js';
import filters from '@/common/banmi/filters.js'
import Bmupload from './common/bmupload/zenkuai_upload.js';
import choose from './common/image/choose.vue'
import upImg from './common/image/up-img.vue'
import upKey from './common/image/up-key.vue'
import upColor from './common/image/up-color.vue'
import upMapQq from './common/image/up-map-qq.vue'
import BmEditor from './components/editor/editor.vue'
Object.keys(filters).map(v => {
	Vue.filter(v, filters[v])
})
Vue.prototype.Http = Http;
Vue.prototype.Banmikeji = Banmikeji;
Vue.prototype.Bmupload = Bmupload;
Vue.component('Http', Http)
Vue.component('upMapQq', upMapQq)
Vue.component('upColor', upColor)
Vue.component('upImg', upImg)
Vue.component('upKey', upKey)
Vue.component('BmEditor', BmEditor)
Vue.component('choose', choose)
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

Vue.prototype.ScanAudio = function(mp3) {
	var music = null;
	music = uni.createInnerAudioContext(); //创建播放器对象
	music.src = mp3;
	music.play(); //执行播放
	music.onEnded(() => {
		//播放结束
		music = null;
	});
}

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif